#region References
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

using DevExpress.XtraEditors;
#endregion

namespace Autumoon.CodeLibrary.Forms
{
    public partial class FeedbackXtraForm : DevExpress.XtraEditors.XtraForm
    {
        // Properties and fields.
        #region Properties and fields
        private static FeedbackXtraForm _instance = null;
        public static FeedbackXtraForm Instance
        {
            get { return ((_instance == null || _instance.IsDisposed) ? _instance = new FeedbackXtraForm() : _instance); }
        }
        #endregion

        // Constructors.
        #region Constructors
        /// <summary>
        /// Required designer variable.
        /// </summary>
        public FeedbackXtraForm()
        {
            // Required for Windows Form Designer support
            InitializeComponent();

            _instance = this;
        }
        #endregion

        // Public methods.
        #region Public Methods
        #endregion

        // Protected methods.
        #region Protected Methods
        #endregion

        // Private methods.
        #region Private Methods
        /// <summary>
        /// Clear all feedback content.
        /// </summary>
        private void ClearAll()
        {
            this.nameTextEdit.Text = this.emailTextEdit.Text = this.contentMemoEdit.Text = String.Empty;
            this.isBugCheckEdit.Checked = false;

            this.nameTextEdit.Focus();
        }
        #endregion

        // Delegates and events.
        #region Delegates and Events
        private void sendSimpleButton_Click(object sender, EventArgs e)
        {
            try
            {
                throw new Exception("The method or operation is not implemented.");
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, ex.Source);
            }
        }

        private void clearAllSimpleButton_Click(object sender, EventArgs e)
        {
            this.ClearAll();
        }

        private void cancelSimpleButton_Click(object sender, EventArgs e)
        {
            this.ClearAll();
            this.Close();
        }
        #endregion
    }
}